import { createRouter,createWebHashHistory, createWebHistory, RouteRecordRaw, RouterLink ,RouterView} from 'vue-router'
// createRouter--创建路由对象的方法
// createWebHashHistory hash模式路由
// createWebHistory 创建历史模式路由
// RouteRecordRaw 路由配置项的接口描述
// RouterLink 路由跳转
// RouterView 路由视图出口
import Home from '../views/Home.vue'


const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path:"/fly",
    name:"fly",
    component:()=>import("../views/Fly.vue")
  },
  {
    path:"/category",
    name:"category",
    component:()=>import("../views/category.vue")
  }
  ,{
    path:"/sugar",
    name:"sugar",
    component:()=>import("../views/suggar.vue")
  },
  {
    path:"/com",
    name:"com",
    component:()=>import("../views/com.vue")
  },{
    path:"/other",
    name:"other",
    component:()=>import("../views/other.vue")
  },{
    path:"/todolist",
    name:"todolist",
    component:()=>import("../views/todoList.vue")
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  }
]
  
const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})


export default router
